package com.bwie.controller;

import com.bwie.domain.User;
import com.bwie.service.UserService;
import com.bwie.utils.R;
import com.bwie.vo.LoginInfoVo;
import com.bwie.vo.PageInfoVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * @Author: lrz
 * @Date: 2024/10/21 09:19
 * @Description:
 **/
@RestController
@RequestMapping("/user/user")
public class UserController {

    @Autowired
    UserService userService;

    @PostMapping("/login")
    public R login(@RequestBody LoginInfoVo loginInfoVo){
        return userService.login(loginInfoVo);
    }

    @PostMapping("/addUser")
    public R addUser(@RequestBody User user){
        return userService.addUser(user);
    }

    @PostMapping("/getCode/{phone}")
    public R getCode(@PathVariable("phone")String phone){
        return userService.getCode(phone);
    }

    @PostMapping("/getUserListEs")
    public R getUserListEs(@RequestBody PageInfoVo pageInfoVo){
        return userService.getUserListEs(pageInfoVo);
    }

}
